UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's8GbYkYAZOO8zXizvNCVws9p+r28iH2W6+gAHzm/JeM='
WHERE
key_id = 'e1cba4cd74cac3586a183f021e31364e3eb2ca28ccfed5b86016008e7e78a95c'
AND (
token = 's8GbYkYAZOO8zXizvNCVws9p+r28iH2W6+gAHzm/JeM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)