UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rBUfXa3XzbzXsiEUOuVVrplSOT3RX7vyHhzEhYg1Xfc='
WHERE
key_id = '4664d665d82136187ecdd94cb3c7a5701a67a44cdf3698bc6ef337ea040a96bc'
AND (
token = 'rBUfXa3XzbzXsiEUOuVVrplSOT3RX7vyHhzEhYg1Xfc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)