UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xF/qet/MMwWZbZ44wbnkdFa7GUGdt1rnDckl5hrRySU='
WHERE
key_id = '44e3efb950a14478d2dacf697f8ac55e252d12146b15ec1d95668d9d0efacada'
AND (
token = 'xF/qet/MMwWZbZ44wbnkdFa7GUGdt1rnDckl5hrRySU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)