UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'S917xuqyum94nHiASeh4M4RJjmSzyvFMSBXm+cOxhZ8='
WHERE
key_id = 'c9a38420d7e1c6f60790659943d8bd4eef94f634888f086ad04cbd9a0828de92'
AND (
token = 'S917xuqyum94nHiASeh4M4RJjmSzyvFMSBXm+cOxhZ8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)