UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'W2f9usNtFJmzzuMfwikdVe7CyWSfHTiR3FLiz+i+pGc='
WHERE
key_id = '2625bff548ffe6055651b990aec9fe58ce5d7d8a3281f4b06d03e4dc4a39a57d'
AND (
token = 'W2f9usNtFJmzzuMfwikdVe7CyWSfHTiR3FLiz+i+pGc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)