UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'izx4pk+7oC8LkmMWGzD4QjkP/SLhXzeciTwHzTijf38='
WHERE
key_id = '20725918dd0f1f422dc64625c8280564b380f64e6e98c5de26f9adaf52b79c39'
AND (
token = 'izx4pk+7oC8LkmMWGzD4QjkP/SLhXzeciTwHzTijf38='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)