UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zR1hGOdojqDx+e0KLVZBwgfIMJ9e4XqskuHwwm6wQIo='
WHERE
key_id = 'a8042df0526ead3d1982e0be40ebbc9c7d55f33159d05c66e8f35226eb7fcea6'
AND (
token = 'zR1hGOdojqDx+e0KLVZBwgfIMJ9e4XqskuHwwm6wQIo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)