UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ewRFzcERfJR7XZHIdqSiSZozClebC6AUi0fJ3JcX2tE='
WHERE
key_id = '847ec7c8a37cb581761303741d32aef34d72f15b2f0b6c60fc090ea79ecef9a9'
AND (
token = 'ewRFzcERfJR7XZHIdqSiSZozClebC6AUi0fJ3JcX2tE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)