UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'L6kzlTs3k/JHqwIg60V+IW49gGK7fJjmbY2MFCL4BMU='
WHERE
key_id = '353cb2870fa046f422554c0528564cc2c2b24c277f181cde6c5a87272a05b923'
AND (
token = 'L6kzlTs3k/JHqwIg60V+IW49gGK7fJjmbY2MFCL4BMU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)