UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'majG8ovXcw+0HvLAHSVBI5YbVpUpXNSBwC98H0CqHpE='
WHERE
key_id = 'a0df9f4d21d71e7c2a04bfae3ce5c4b08de2cf530383f70a3ae23e374d3d1ca6'
AND (
token = 'majG8ovXcw+0HvLAHSVBI5YbVpUpXNSBwC98H0CqHpE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)