UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WTg3x4GRYPskW9OpeXhgKCaZPt7L2aj+r+eCxHJIE9E='
WHERE
key_id = 'df33fb41c8ca960de357c64cde5f93408cfd8b8f2142c4b17f289b5e7f464d00'
AND (
token = 'WTg3x4GRYPskW9OpeXhgKCaZPt7L2aj+r+eCxHJIE9E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)