UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fV+zgMKOnb+wkanWj6Tew8KI8fyr7c6VFoaggEy6bkY='
WHERE
key_id = 'ca79c531dcd1d21ed0cc43601d57b035c4da7bb1e8540f787cc93651b0343058'
AND (
token = 'fV+zgMKOnb+wkanWj6Tew8KI8fyr7c6VFoaggEy6bkY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)