UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BVbaQIObkBbOxxoDU0ToJsYTdyOZ4hkna9q3RRmAcHc='
WHERE
key_id = '4cb302d9270557fc555766c666198a4dc6b0d039cc2fb56a8bdd480e8e42c703'
AND (
token = 'BVbaQIObkBbOxxoDU0ToJsYTdyOZ4hkna9q3RRmAcHc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)