UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LHAFNfot/HGfE/qXNNfxeG8VaYdLs9wCEfhEJWYn/A8='
WHERE
key_id = '84b0e9ba0efe60c16a526a17cfbc0169511244fd1ba9cc6915b5f9c01f6a90fc'
AND (
token = 'LHAFNfot/HGfE/qXNNfxeG8VaYdLs9wCEfhEJWYn/A8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)