UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6VpAItSTMqcGzyHifShtYWVAksKJ56Wij6/la3eLEWQ=' 
WHERE 
  key_id = '8d81cae4f006dd930a260aafbea84f6065a8f698c0b1c3f0056156a62ff3d6d9' 
  AND (
    token = '6VpAItSTMqcGzyHifShtYWVAksKJ56Wij6/la3eLEWQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024