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

Query time 0.00064