UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's1mxLLZGVFDmisjXv2ZeXhiYM8k6sqV8xmIpzhB9sNc='
WHERE
key_id = '8445ba9834d457ece04de655a7a9cf91a2728df0843111b4dbcebc9f43c3f567'
AND (
token = 's1mxLLZGVFDmisjXv2ZeXhiYM8k6sqV8xmIpzhB9sNc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)