UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '23LF04eIqXBkPoB9qdIAQh3K13a8JaiJE+wd2cQZzmo=' 
WHERE 
  key_id = '69bf0d288d8904a034890086275de879bf284d7260920ee8656a7e2936e7398d' 
  AND (
    token = '23LF04eIqXBkPoB9qdIAQh3K13a8JaiJE+wd2cQZzmo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024