UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7+fOlngr03BucboxlCQT3/H3w2Ub4+l01zKyGPf3+js=' 
WHERE 
  key_id = 'e0463a4628e08133d74248df8b2de956fefe97c62cc4d318983e3929cb95ef6e' 
  AND (
    token = '7+fOlngr03BucboxlCQT3/H3w2Ub4+l01zKyGPf3+js=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021