UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1lvcrFUJ4OiKYZNtzS8p1i9TeV4rlRtLaFFH1VEtL3o=' 
WHERE 
  key_id = 'c480484d352fc15dfb35b1441818e4826208e25f339a898e4439348a3da972c8' 
  AND (
    token = '1lvcrFUJ4OiKYZNtzS8p1i9TeV4rlRtLaFFH1VEtL3o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00070