UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0hxi9UzPR2QIS8v2ZB5BubW81p4wOMTsQdenWt3k9eo=' 
WHERE 
  key_id = '4f56f25a11b454b5cd09a6b511596769799ad045d7aefaf718e3f233cb44865c' 
  AND (
    token = '0hxi9UzPR2QIS8v2ZB5BubW81p4wOMTsQdenWt3k9eo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030