UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CSP0r77Ju8q4MaGy2K/+1bha0HLszaR9BUy1vaRtWLY='
WHERE
key_id = '1cfcf33101035dfbea0045039db60398a4fc6ef4fad022d797ed0f349eb7365c'
AND (
token = 'CSP0r77Ju8q4MaGy2K/+1bha0HLszaR9BUy1vaRtWLY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)