UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oMEb6cQoY1yjpPF4vUJuXipHY96/Ubbepuw++B1leRk=' 
WHERE 
  key_id = '5ab784cbeed6162745fa2e72fff7286792590bb5f8f8192704b44d993b420de0' 
  AND (
    token = 'oMEb6cQoY1yjpPF4vUJuXipHY96/Ubbepuw++B1leRk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040