UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1e52QmnwG9BulhLtht5NjihDPlaSzTf6+MOTyeISnhg='
WHERE
key_id = '5fc788c3894a955d00484ac170f4626a83dc95ba4ee876cc823c00a979d610e1'
AND (
token = '1e52QmnwG9BulhLtht5NjihDPlaSzTf6+MOTyeISnhg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)