UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's7UjLF9m278kgaFQWkCeLE1umTXihLlDDkvMDC8YGng='
WHERE
key_id = '436be94f229126acd7d31b613dde7a73274b95c03456d91324829a8504037598'
AND (
token = 's7UjLF9m278kgaFQWkCeLE1umTXihLlDDkvMDC8YGng='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)