UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+7ECxTLb+U9yieQDVchF9Gk1ktf9zj/44OQbGfzGhW0='
WHERE
key_id = '2a94311aebc529a2919e9c8708c3ceb3e5f713ea4063b119ebba95a2189574fc'
AND (
token = '+7ECxTLb+U9yieQDVchF9Gk1ktf9zj/44OQbGfzGhW0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)