UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WvKkRjklUXqb6bfgRMQgbzZ9iUWRxjXf8yhC5klaOBc='
WHERE
key_id = '711a207214cbeeb5df67d8ea3d3e9f4f49d64d093627867f924b8c33c1b6150a'
AND (
token = 'WvKkRjklUXqb6bfgRMQgbzZ9iUWRxjXf8yhC5klaOBc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)