UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XvLZ6CCKyq9wF0CugQ4Way+qBUt3wYWNIgk+nk6d6ac='
WHERE
key_id = 'b81bc0f8e32a70034d668a6b4b562f950ff95fad34d991d1bd602c167c95043c'
AND (
token = 'XvLZ6CCKyq9wF0CugQ4Way+qBUt3wYWNIgk+nk6d6ac='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)