UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dK6+xXJIm3VzBqFc/udyR2ERhYdWZky74dMk4oOuuhU='
WHERE
key_id = 'a054430550db5a3fcb7a14b65dafd069ae8003e8359d2c5c3c45cae06404550f'
AND (
token = 'dK6+xXJIm3VzBqFc/udyR2ERhYdWZky74dMk4oOuuhU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)