UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CXHsHa3ldiSnKwsWbXGWERjcCm1OntlUsROrMqgyfgE='
WHERE
key_id = 'b5be89f64ebaa5202bde0d3ff554f88784074a124b705ad00601246ac6a680fd'
AND (
token = 'CXHsHa3ldiSnKwsWbXGWERjcCm1OntlUsROrMqgyfgE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)