UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OoLIVcY6NpRXevNSsHWNPVeE0G38sqUBSvC7j/RqXd8='
WHERE
key_id = 'b68ad5020db0084c3b55184e13865d3a3143f76f2bd194a5fbae4ea64fa38a99'
AND (
token = 'OoLIVcY6NpRXevNSsHWNPVeE0G38sqUBSvC7j/RqXd8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)