UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Q0FzahItzW8/1yQSeTMtmiQt5tx7SJzm0PiegmRnZPo=' 
WHERE 
  key_id = '7802992e9f59d8baed7ea995b576533ddc20f6d030bfb96b8621697150a6e28b' 
  AND (
    token = 'Q0FzahItzW8/1yQSeTMtmiQt5tx7SJzm0PiegmRnZPo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029