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